function circle(r){
         return r*Math.PI*r
}
console.log(circle(2));

function writeIsosceles(num){
  let str1 = ''
  let count = 0
  let num1 = 1
  let del = num * 2 - 1
  while (count < num) {
    if (num1 % 2 != 0) {
      let whitespace = (del - num1) / 2
      for (let u = 0; u < whitespace; u++) {
        str1 += '   '
      }
      for (let j = 0; j < num1; j++) {
        str1 += ' * '
      }
      str1 += '\n'
      count += 1
    }
    num1 += 1
  }
  return str1
}
console.log(writeIsosceles(20))

// function jiecheng1(num) {
//   let count = 1
//   for (let i = 2; i <= num; i++) {
//     count *= i
//   }
//   return count
// }

// function addjiecheng(num){
//     let total =0
//      for(let i=1;i<=num;i++){
//           total+= jiecheng1(i)
//      }
//      return total

// }

// console.log(addjiecheng(20))

// function numLength(num){
//       return String(num).length
// }


function remainder(num) {
  if (Object.prototype.toString.call(num) === '[object Number]'&&Boolean(num)){
    return (parseInt(num) + 5) % 10
  }
  return '加密失败！'
}
function sha666(text) {
  let str = String(text)
  let new_str = ''
  if (str.length == 4) {
    for (let i = 0; i < 4; i++){
      let sha = remainder(str[i] * 1)
      new_str += (sha+',')
    }
    let new_text =new_str.split(',').reverse().join('')
    return new_text
  }
  return false
}

console.log( sha666('121'));
